<template>
  <div class="home">
    <h1>欢迎使用Vue项目</h1>
    <h2>{{tip}}</h2>
    <h3>{{moduleTip}}</h3>
    <el-button type="primary" class="p-wrap" @click="getJokes()">饿了么Button组件</el-button>
  </div>
</template>

<script>
// import * as API from 'api/demo'
import * as Api from 'api/openapi.js'

export default {
  name: 'home',
  mounted() {
  },
  methods: {
    getJokes() {
      let data = new URLSearchParams;
      data.append('type', 1)
      data.append('page', 1)
      Api.getJokes(data).then(res => {
        console.log(res)
      }).catch(err => {
        console.log(res)
      })
    }
  }
}
</script>
<style scoped>
  .home {
    text-align: center;
  }
</style>